export function isHttpUrl(url: string): boolean {
  return /^https?:\/\//i.test(url.trim());
}

export function isValidTemplate(tpl: string): boolean {
  return /%s/.test(tpl);
}

export function composeUrl(template: string, query: string): string {
  return template.replace('%s', encodeURIComponent(query));
}
